<template>
	<view class="team-content">
		<view class="listBox">
			<view class="listItem" @click="oneActive(1)">
				<view class="itemName">{{$t('home.team.oneLevel')}}</view>
				<view class="rightBox">
					<view class="rightSpan">{{oneLevelNum}}</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="listItem" @click="oneActive(2)">
				<view class="itemName">{{$t('home.team.twoLevel')}}</view>
				<view class="rightBox">
					<view class="rightSpan">{{secondLevelNum}}</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="listItem" @click="oneActive(3)">
				<view class="itemName">{{$t('home.team.thirdLevel')}}</view>
				<view class="rightBox">
					<view class="rightSpan">{{threeLevelNum}}</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		subUserCount
	} from "@/api/terminal/terminal_info.js"

	export default {
		data() {
			return {
				oneLevelNum: 0,
				secondLevelNum: 0,
				threeLevelNum: 0,
			};
		},
		onLoad() {
			subUserCount().then(rsp => {
				if (rsp.code == 200) {
					this.oneLevelNum = rsp.data.oneLevelNum;
					this.secondLevelNum = rsp.data.secondLevelNum;
					this.threeLevelNum = rsp.data.threeLevelNum;
				}
			})
		},
		onNavigationBarButtonTap(e) {
			//e.index 如果是俩图标的话，index然后的0 或者1  就知道点击的哪个
			uni.navigateTo({
				url: '/pages/mine/record/team-reward-record'
			})
		},
		methods: {
			oneActive(type) {

				uni.navigateTo({
					url: '/pages/home/team-list?type=' + type
				})
			},

		},

	}
</script>

<style lang="scss">
	page {
		background-color: $uni-color-bg;
		color: white;
	}

	.team-content {


		.listBox {
			padding: 0 10px;

			.listItem {
				margin-top: 10px;
				display: flex;
				justify-content: space-between;
				align-items: center;
				background-color: $uni-color-box;
				box-shadow: 0 3px 6px 1px rgba(0, 0, 0, .12);
				border-radius: 10px;
				padding: 20px 12px;
				margin-bottom: 10px;
				font-size: 14px;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;

				.itemName {
					margin: 0;
					-webkit-tap-highlight-color: transparent;
				}

				.rightBox {
					display: flex;
					align-items: center;

					.rightSpan {
						display: inline-block;
						padding-right: 12px;

					}
				}
			}
		}

	}
</style>